/*
** 2301.c
** 
** Made by (seakage2h)
** Login   <seakage2h@seakage2h-ubuntu>
** 
** Started on  Fri Oct  3 22:30:40 2008 seakage2h
** Last update Sun May 12 01:17:25 2002 Speed Blue
*/

/* #include "2301.h" */
#include <stdio.h>

int main()
{
     int instance, t, d;
     scanf("%d", &instance);
     while(instance){
	  scanf("%d%d", &t, &d);
	  if (t < d || (t - d) % 2)
	       printf("impossible\n");
	  else
	       printf("%d %d\n", (t+d)/2, (t-d)/2);
	  instance--;
     }
     return 0;
}

